﻿using MediatR;
using System.CJL.API.Application.Command.StorageCommand;
using System.CJL.Domain;
using System.CJL.Infrstructre.Interface;

namespace System.CJL.API.Application.CommandHanlder.StorageCommandHandler
{
    /// <summary>
    /// 返填
    /// </summary>
    public class StorageMondelCommandHandler : IRequestHandler<StorageMondelCommand,Storage>
    {
        IStorageRepository _storageRepository;
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="storageRepository"></param>
        public StorageMondelCommandHandler(IStorageRepository storageRepository)
        {
            _storageRepository = storageRepository;
        }

        public async Task<Storage> Handle(StorageMondelCommand request, CancellationToken cancellationToken)
        {
            var list = await _storageRepository.GetMondel(request.id);
            return list;
        }
    }
}
